-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make calls on cacheArtifacts/reconnect/submit/canel non-blocking #556
Conversation
@@ -259,6 +259,13 @@ protected TaskExecutorGateway getGateway() throws ExecutionException, Interrupte | |||
return this.gateway.get(); | |||
} | |||
|
|||
protected CompletableFuture<TaskExecutorGateway> getGatewayAsync() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this be async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Do get rid of the blocking method, as it could lead to potential bad usage in the future.
@@ -118,7 +118,7 @@ CompletableFuture<TaskExecutorID> getTaskExecutorFor( | |||
*/ | |||
CompletableFuture<TaskExecutorGateway> getTaskExecutorGateway(TaskExecutorID taskExecutorID); | |||
|
|||
CompletableFuture<TaskExecutorGateway> reconnectTaskExecutorGateway(TaskExecutorID taskExecutorID); | |||
CompletableFuture<Ack> reconnectTaskExecutorGateway(TaskExecutorID taskExecutorID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/reconnect.*Gateway/reconnect
@@ -259,6 +259,13 @@ protected TaskExecutorGateway getGateway() throws ExecutionException, Interrupte | |||
return this.gateway.get(); | |||
} | |||
|
|||
protected CompletableFuture<TaskExecutorGateway> getGatewayAsync() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to explicitly call this method async since the type already reflects that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, get rid of the blocking method.
@@ -112,6 +115,8 @@ public Receive createReceive() { | |||
.match(FailedToSubmitScheduleRequestEvent.class, this::onFailedToSubmitScheduleRequestEvent) | |||
.match(RetryCancelRequestEvent.class, this::onRetryCancelRequestEvent) | |||
.match(Noop.class, this::onNoop) | |||
.match(Ack.class, ack -> log.debug("Received ack from {}", sender())) | |||
.match(Failure.class, failure -> log.error("Received failure from {}: {}", sender(), failure)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is this message sent?
Context
Convert the get resourceGateway calls (which perform RPC connection inside) to return future and perform the actions on the future's completion instead of blocking and waiting.
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all tests